authentication-services-colmena icon

authentication-services-colmena

(2 reviews)

How to Get a New Token

1. Authorize the Application to Act on Behalf of a Colmena User

Using the Client ID from the connected app job-connected-apps-auth-token-{env}, authorization must be requested to allow the application to act as a user.

Values

| --------- | --------------------------------- |

| Host: | anypoint.mulesoft.com |

| URL: | /accounts/api/v2/oauth2/authorize |

Input Paramenters:

Query ParametersValueDescripcion
client_idclient_id de connectedapp: job-connected-apps-auth-token-{env}
scopeoffline_access%20fullscopes para solicitar token y refresh token
response_typecodetipo de respuesta esperado
redirect_urihttps://google.comurl de redireccion al recibir respuesta
nonce123456valor default

Example Request


anypoint.mulesoft.com/accounts/api/v2/oauth2/authorize?client_id=asd5f4aa5sd4fa6s5&scope=offline_access%20full&response_type=code&redirect_uri=[https://google.com&nonce=123456](https://google.com&nonce=123456)

resources/authorizeapp-185830e2-8557-49d5-8d1c-f44d06cbf8b7.jpeg

2. Request a Token

Input Parameters

Request:

POST /accounts/api/v2/oauth2/token HTTP/1.1
Host: anypoint.mulesoft.com
Content-Type: application/json
{
  "client_id": "",
  "redirect_uri": "https://example.com",
  "client_secret": "",
  "grant_type": "authorization_code",
  "code": ""
}
ParameterValueDescription
client_idclient_id from connected app: job-connected-apps-auth-token-{env}Unique ID of the connected app
redirect_urihttps://google.comURL to redirect upon receiving the response.
client_secretclient_secret from connected app: job-connected-apps-auth-token-{env}Secret key of the connected app
grant_typeauthorization_codeDefault value
codeCode obtained from the previous step

Output parameters

HTTP/1.1 200 OK
Content-Type: application/json

{
  "access_token": "",
  "refresh_token": "",
  "expires_in": "",
  "token_type": "bearer"
}

3. Use Refresh Token

In Runtime Manager under authentication-services-colmena > properties, update the following values:

ParameterDescription
token.client_idclient_id from connected app: job-connected-apps-auth-token-{env}
secure::token.client_secretclient_secret from connected app: job-connected-apps-auth-token-{env}
secure::token.refresh_tokenRefresh token obtained in the previous step

resources/Screen%20Shot%202022-11-06%20at%201.53.26-86064f99-febf-49fe-9e69-2c28d0c7f212.png


Reviews